package com.scpii.universal.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * genericWeb
 * 
 * @author liuhj 2012-7-8上午10:14:59
 */
public class GenericConstants {
	/**
	 * 逻辑删除符 0:存在，1:已删除，2:不显示
	 */
	public static final int DELETE_SIGN_DELETED = 1;
	public static final int DELETE_SIGN_EXIST = 0;
	public static final int DELETE_SIGN_NOT_SHOW = 2;

	/**
	 * ehcache name
	 */
	public static final String CATELOG_EHCACHE = "catelogCache";
	public static final String GLOBAL_EHCACHE = "globalCache";

	// 用户基本信息
	public static final String USER_INFO = "userInfo";
	// 全局属性配置文件路径
	public static final String GLOBAL_PROPERTIES_PATH = "universal";
	// 应用版本初始version
	public static final double APP_UPDATE_FIRST_VERSION = 1.00;
	// 临时应用icon session名字
	public static final String TEMP_APP_ICON_SESSION = "tempAppIconSession";
	// 临时缩略图 session名字
	public static final String TEMP_CATELOG_ICON_SESSION = "tempCatelogIconSession";

	// 逻辑删除符字段名
	public static final String LOGIC_DELETE_SIGN = "intDeleteSign";
	// 每页显示多少条
	public static final int PAGE_NO = 5;
	public static final int PAGE_NO_10 = 10;
	// 应用logo名字后缀
	public static final String APP_LOGO_SUFFIX = "app_logo.png";
	// 应用loading名字后缀
	public static final String APP_LOADING_SUFFIX = "app_loading.png";
	// 标题icon名字后缀
	public static final String TITLE_ICON_SUFFIX = "_title_icon.png";
	// 导航icon名字后缀
	public static final String NAVIGATION_ICON_SUFFIX = "_navigation_icon.png";
	// 应用通用素材后缀
	public static final String MYAPP_ICON_SUFFIX = "_my_material.png";
	// 分类缩略图名字后缀
	public static final String CATELOG_ICON_SUFFIX = "_catelog_icon.png";
	// 操作成功
	public static final String OPERATION_SUCCESS = "0";
	// 查询为空
	public static final String OPERATION_NULL = "-1";
	// 生成平台每次查询的记录条数
	public static final int PAGE_SIZE_FOR_PRODUCE = 10;
	/**
	 * 视图分类关联跳转页面的下级类型 0、分类 1、内容
	 */
	public static final int NEXT_PAGE_CONTENT_TYPE_CATE = 0;
	public static final int NEXT_PAGE_CONTENT_TYPE_LIST = 1;

	/**
	 * 应用图标类型 0：Loading图标、1：导航图标、2：Title图标、3：应用背景图片、4：生成平台上传的LOADING图标
	 * 5：应用图标、6：应用导航背景图片
	 * 、7：页面标题背景图片、8：混合图标(可多用)、9：更新后的LOADING，客户端需此标识检查是否需要更新loading
	 */
	public static final byte ICON_TYPE_LOADING = 0;
	public static final byte ICON_TYPE_NAVIGATION = 1;
	public static final byte ICON_TYPE_TITLE = 2;
	public static final byte ICON_TYPE_BACKGROUND_APP = 3;
	public static final byte ICON_TYPE_LOADING_PRODUCE = 4;
	public static final byte ICON_TYPE_APP_ICON = 5;
	public static final byte ICON_TYPE_BACKGROUND_NAVI = 6;
	public static final byte ICON_TYPE_BACKGROUND_TITLE = 7;
	public static final byte ICON_TYPE_ALL_CAN_USE = 8;
	public static final byte ICON_TYPE_LOADING_NEED_TO_UPD = 9;
	/**
	 * 图标定义类型 0：系统默认定义、1：用户自定义
	 */
	public static final int ICON_DEFINE_TYPE_SYS = 0;
	public static final int ICON_DEFINE_TYPE_USER = 1;
	// LOADING默认名字
	public static final String LOADING_DEFAULT_NAME = "Loading pic";
	// 页面标题默认名字
	public static final String PAGE_TITLE_DEFAULT_NAME = "Title";

	/**
	 * 留言回复设置 0：未回复、1：已回复 、0：顶级回复的parentID
	 */
	public static final int FEED_BACK_PARENT_ID = 0;
	public static final int FEED_BACK_REPLAY_YES = 1;
	public static final int FEED_BACK_REPLAY_NO = 0;

	// 应用图标名字
	public static final String APP_ICON_DEFAULT_NAME = "app icon";
	/**
	 * 操作系统类型 0：Android、1：IOS
	 */
	public static final int OPERATION_SYS_ANDROID = 0;
	public static final int OPERATION_SYS_IOS = 1;

	/**
	 * 是否有叶子节点 0：没有、1：有
	 */
	public static final int IS_HAS_LEAF_NO = 0;
	public static final int IS_HAS_LEAF_YES = 1;

	/**
	 * 视图绑定的数据类型 0：分类、1：内容、2：功能
	 */
	public static final int BINDING_DATA_TYPE_CATELOG = 0;
	public static final int BINDING_DATA_TYPE_CONTENT = 1;
	public static final int BINDING_DATA_TYPE_FUNCTION = 2;

	// 日期格式
	public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
	// 微博类型的父id
	public static final Integer MISCRO_BO_TYPE_ID = 5;
	// 企业行业类型的父id
	public static final Integer ENTER_TYPE_ID = 17;
	// 推动消息类型
	public static final Integer PUSH_MSG_TYPE_ID = 3;
	// 推动消息状态
	public static final Integer PUSH_MSG_STATUS_ID = 10;
	// 分享类型
	public static final Integer SHARE_TYPE_ID = 12;
	// 收藏类型
	public static final Integer FAVOURT_TYPE_ID = 13;
	// 应用类型
	public static final Integer APP_OS_TYPE_ID = 4;
	/**
	 * 应用风格包含的图片类型（0：标题背景、1：应用背景、2：导航背景、3：列表背景） 4:导航按下后的图标背景
	 */
	public static final int STYLE_TYPE_TITLE = 0;
	public static final int STYLE_TYPE_APP_BackGROUND = 1;
	public static final int STYLE_TYPE_NAV = 2;
	public static final int STYLE_TYPE_LIST = 3;
	public static final int STYLE_TYPE_PRESS = 4;

	/**
	 * 功能动作
	 */
	public static final int BASIC_TYPE_ID_ACTION_PARENT = 16;
	public static final int BASIC_TYPE_PHONE = 1;
	public static final int BASIC_TYPE_LINK = 2;
	public static final int BASIC_TYPE_ORDER = 3;
	public static final int BASIC_TYPE_FAVIORATE = 4;
	public static final int BASIC_TYPE_SHARE = 5;
	public static final int BASIC_TYPE_ACTIVITY = 6;

	/**
	 * 导航类型 0为普通导航，1为更多导航
	 */
	public static final int NAV_TYPE_COMMON = 0;
	public static final int NAV_TYPE_MORE = 1;

	public static final String WEB_URL = "http://localhost:8080/";

	/**
	 * 页面板式
	 */
	// 导航
	public static final int NAV_STYLE_FULL = 1001;
	// 全列表
	public static final int LIST_STYLE_FULL_1 = 2001;
	public static final int LIST_STYLE_FULL_2 = 2002;
	public static final int LIST_STYLE_FULL_3 = 2003;
	// 半列表
	public static final int LIST_STYLE_HALF_1 = 3001;
	public static final int LIST_STYLE_HALF_2 = 3002;
	public static final int LIST_STYLE_HALF_3 = 3003;
	// 全宫格
	public static final int GRID_STYLE_FULL_1 = 4001;
	public static final int GRID_STYLE_FULL_2 = 4002;
	public static final int GRID_STYLE_FULL_3 = 4003;
	// 半宫格
	public static final int GRID_STYLE_HALF_1 = 5001;
	public static final int GRID_STYLE_HALF_2 = 5002;
	public static final int GRID_STYLE_HALF_3 = 5003;
	// 全画廊
	public static final int GALLERY_STYLE_FULL_1 = 6001;
	public static final int GALLERY_STYLE_FULL_2 = 6002;
	// 半画廊
	public static final int GALLERY_STYLE_HALF_1 = 7001;
	public static final int GALLERY_STYLE_HALF_2 = 7002;
	// 活动
	public static final int LIST_STYLE_ACTIVITY = 2085;
	// 登录
	public static final int LOGIN_STYLE = 8001;

	/**
	 * 0绑定为分类下的内容列表，1为绑定的内容
	 */
	public static final int ISBINDLISTDIRECTLY_YES = 0;
	public static final int ISBINDLISTDIRECTLY_NO = 1;

	// 新增版本时每次递增数
	public static final double VERSION_INCREMENT_NUMBER = 0.01;

	// 定义内容图片的类型
	// 为内容详细页面中的包含的内容图片
	public static final int CONTENT_IMG_TYPE_DETAIL = 0;
	// 为内容对应的相册图片
	public static final int CONTENT_IMG_TYPE_PHOTO = 1;

	/**
	 * 系统属性
	 */
	public static final int SYSTEM_CATELOG_ID_PRODUCT = 1;// 产品
	public static final int SYSTEM_CATELOG_ID_NEWS = 2;// 新闻
	public static final int SYSTEM_CATELOG_ID_ACTIVE = 3;// 活动
	public static final int SYSTEM_CATELOG_ID_HOUSE = 4;// 房产聚合

	/**
	 * 房产聚合对应的属性
	 */
	public static final int HOUSE_PHONENUM = 8;// 电话
	public static final int HOUSE_AREA = 9;// 区域
	public static final int HOUSE_PRICE = 10;// 价格
	public static final int HOUSE_TYPE = 11;// 类型

	/**
	 * 房产的价格区间
	 */
	public static final int LOW_5000 = 7;// 小于5000
	public static final int BETWEEN_5000_8000 = 8;// 5000与8000之间
	public static final int BETWEEN_8000_10000 = 9;// 8000与10000之间
	public static final int MORE_10000 = 10;// 大于10000

	public static final int PRI_5000 = 5000;
	public static final int PRI_8000 = 8000;
	public static final int PRI_10000 = 10000;
	/**
	 * 扩展属性输入类型 0输入，1选择
	 */
	public static final int ATTRIBUTE_INPUT_TYPE_INPUT = 0;
	public static final int ATTRIBUTE_INPUT_TYPE_SELECT = 1;

	/**
	 * 应用版本更新状态 0:无更新、1:必须更新、2:可选更新
	 */
	public static final int APP_VERSION_UPDATE_NO = 0;
	public static final int APP_VERSION_UPDATE_MUST = 1;
	public static final int APP_VERSION_UPDATE_OPTION = 2;

	/**
	 * 是否发布过更新 0：发布过，1：没发布过
	 */
	public static final int APP_VERSION_DEPLOYED_YES = 0;
	public static final int APP_VERSION_DEPLOYED_NO = 1;

	public static final String IMG_RELATIVE_PREFIX = "WORKDIR/";
	public static final String CRONTAB_FLAG_ON = "crontab.flag.on";
	public static final String SERVER_URL_PREFIX = "resource.serverURL";
	public static final String DISPATCH_SERVER_URL = "UniversalDispatch.serverHost";
	public static final String COPY_HOUSE_SYSCATELOG = "sysCatelog.copy.house";
	public static final String REGISTER_PAGE_SHOW = "register.page.show";
	public static final String MESSAGE_PUSH_MODULE_SHOW = "message.push.module.show";
	public static final String SHARE_MODULE_SHOW = "share.module.show";
	public static final String FAVORITE_MODULE_SHOW = "favorite.module.show";
	public static final String USER_MANAGE_MODULE_SHOW = "user.manage.module.show";

	/**
	 * 是非选项 0:不是，1:是
	 */
	public static final int OPTION_NO = 0;
	public static final int OPTION_YES = 1;

	/**
	 * 表名
	 */
	public static final String CONTENT_TABLE_NAME = "CONTENT_TAB";

	// request流请求参数长度
	public static final int REQUEST_HEADER_LENGTH = 512;
	// excel导入用户信息唯一标识字段
	public static final String UNIQUE_USER_ATTR = "用户名";

	// 详情页图片宽度
	public static final int CONTENT_DETAIL_IMG_WIDTH = 765;

	// add by zhangqinag 2013/3/26 new activities constants
	public static final String TYPE_TXT = "TXT";
	public static final String TYPE_PHONE = "PHONE";
	public static final String TYPE_IMAGE = "IMAGE";
	public static final String TYPE_AUDIO = "AUDIO";
	public static final String TYPE_VIDEO = "VIDEO";
	public static final String TYPE_MAP = "MAP";

	// 圈子在moreconten表中的type
	public static final Integer CIRCLE_MORE_TYPE = 14;

	public static Long APP_ID_PRE = 111000000000l;
	public static Long SHOP_ID_PRE = 530000000000l;
	public static Long CATE_ID_PRE = 550000000000l;

	// 用户动作定义
	// 动作类型 COMMENTS_ADD ACTIVITES_FORWARD 活动转发
	// 评论添加 ACTIVITES_SHARE 分享 ACTIVITES_JOIN
	// 活动参加 ACTIVITES_FAV 活动感兴趣,USER_LOGIN 用户登陆,
	// USER_REGISTER用户注册,EC_FAVORITE 电商收藏
	public static final String USER_ACTIONS_COMMENTS_ADD = "COMMENTS_ADD";
	public static final String USER_ACTIONS_ACTIVITES_FORWARD = "ACTIVITIES_FORWARD";
	public static final String USER_ACTIONS_ACTIVITES_SHARE = "ACTIVITIES_SHARE";
	public static final String USER_ACTIONS_ACTIVITES_JOIN = "ACTIVITIES_JOIN";
	public static final String USER_ACTIONS_ACTIVITES_FAV = "ACTIVITIES_FAV";
	public static final String USER_ACTIONS_REPLAY_ADD = "REPLY_ADD";
	public static final String USER_ACTIONS_USER_LOGIN = "USER_LOGIN";
	public static final String USER_ACTIONS_USER_REGISTER = "USER_REGISTER";
	public static final String USER_ACTIONS_EC_FAVORITE = "EC_FAVORITE";
	public static final String USER_ACTIONS_EC_ORDER_ADD = "EC_ORDER_ADD";
	public static final String USER_ACTIONS_COMMENTS_LIKE = "COMMENTS_LIKE";
	public static final String USER_ACTIONS_APP_PRE_ACTIVITIES = "10";
	public static final String USER_ACTIONS_APP_PRE_USERS = "16";
	public static final String USER_ACTIONS_APP_PRE_CIRCLE = "40";
	public static final String USER_ACTIONS_APP_PRE_COMMENTS = "14";

	public static Map<String, Long> TABLE_PRIKARY_KEY_START_POSITION = new HashMap<String, Long>();
	static {
		TABLE_PRIKARY_KEY_START_POSITION.put("ACTIVITIES", 10l);
		TABLE_PRIKARY_KEY_START_POSITION.put("APPINFO", 110l);
		TABLE_PRIKARY_KEY_START_POSITION.put("APPINFO_UNIVERSAL", 111l);
		TABLE_PRIKARY_KEY_START_POSITION.put("CATEGORIES", 12l);
		TABLE_PRIKARY_KEY_START_POSITION.put("RESOURCES", 13l);
		TABLE_PRIKARY_KEY_START_POSITION.put("COMMENTS", 14l);
		TABLE_PRIKARY_KEY_START_POSITION.put("USER_ACTIONS", 15l);
		TABLE_PRIKARY_KEY_START_POSITION.put("USERS", 16l);
		TABLE_PRIKARY_KEY_START_POSITION.put("USERS_LINKS", 17l);
		TABLE_PRIKARY_KEY_START_POSITION.put("ADDRESS", 18l);
		TABLE_PRIKARY_KEY_START_POSITION.put("APP_CONFIGS", 19l);
		TABLE_PRIKARY_KEY_START_POSITION.put("APP_MODULES", 20l);
		TABLE_PRIKARY_KEY_START_POSITION.put("APP_NODES", 21l);
		TABLE_PRIKARY_KEY_START_POSITION.put("APP_ORDERS", 22l);
		TABLE_PRIKARY_KEY_START_POSITION.put("APP_ORDERS", 22l);
		TABLE_PRIKARY_KEY_START_POSITION.put("APP_TEMPLATES", 23l);

		TABLE_PRIKARY_KEY_START_POSITION.put("ARTICLES", 24l);
		TABLE_PRIKARY_KEY_START_POSITION.put("AUTO_USER_CARS", 25l);
		TABLE_PRIKARY_KEY_START_POSITION.put("AUTO_USER_IMPORTS", 26l);
		TABLE_PRIKARY_KEY_START_POSITION.put("DEVICES", 27l);
		TABLE_PRIKARY_KEY_START_POSITION.put("DICTS", 28l);
		TABLE_PRIKARY_KEY_START_POSITION.put("FIELD", 29l);
		TABLE_PRIKARY_KEY_START_POSITION.put("FIELD_VALUES", 30l);
		TABLE_PRIKARY_KEY_START_POSITION.put("TAG_VALUES", 31l);
		TABLE_PRIKARY_KEY_START_POSITION.put("TAGS", 32l);
		TABLE_PRIKARY_KEY_START_POSITION.put("USER_VISITS", 33l);

		// =======**************电商相关 start**************=======
		TABLE_PRIKARY_KEY_START_POSITION.put("EC_ORDER_DETAILS", 34L); // 订单详情
		TABLE_PRIKARY_KEY_START_POSITION.put("EC_ORDERS", 35L); // 订单
		TABLE_PRIKARY_KEY_START_POSITION.put("EC_PAYMENT_CONFIG", 36L);// 支付方式配置
		TABLE_PRIKARY_KEY_START_POSITION.put("EC_PRODUCT", 37L); // 商品
		TABLE_PRIKARY_KEY_START_POSITION.put("EC_SHOPPING_CAR", 38L); // 购物车
		TABLE_PRIKARY_KEY_START_POSITION.put("EC_PAYMENT_LOG", 39L); // 支付日志
		// =======**************电商相关 end****************=======

		TABLE_PRIKARY_KEY_START_POSITION.put("ACTIVITES_UNIVERSAL", 40l);

		// =======**************推送 start >>>>>>>>>**************=======
		TABLE_PRIKARY_KEY_START_POSITION.put("MESSAGE", 41L); // 推送消息
		TABLE_PRIKARY_KEY_START_POSITION.put("USER_CONFIGS", 42L); // 用户配置
		TABLE_PRIKARY_KEY_START_POSITION.put("USER_DEVICES", 43L); // 用户和设备之间的关系
		TABLE_PRIKARY_KEY_START_POSITION.put("USER_MESSAGE_DEVICES", 44L); // 用户消息
		TABLE_PRIKARY_KEY_START_POSITION.put("USER_MESSAGES", 45L); // 用户消息
		// =======**************推送 end >>>>>>>>>>>**************=======

		TABLE_PRIKARY_KEY_START_POSITION.put("USER_POINT_RANKS", 46l);
		TABLE_PRIKARY_KEY_START_POSITION.put("DEVICE_APP", 47L);
		TABLE_PRIKARY_KEY_START_POSITION.put("CONTENT_UNIVERSAL", 48l);// 通用版内容
		TABLE_PRIKARY_KEY_START_POSITION.put("USER_ACTION_POINT_CONFIG", 49l);
		TABLE_PRIKARY_KEY_START_POSITION.put("USER_POINT_HISTORY", 50l);
		TABLE_PRIKARY_KEY_START_POSITION.put("USER_ACTION_STATE", 51l);
	}

}
